<?php
class device_Model extends MY_Model{
	public function __construct(){
		parent::__construct();
		$this->setTable('device');
	}
	
	function getAllSort($where = array(),$orderBy = ""){
		if(!is_null($where)) $this->db->where($where);
		if($orderBy !== "") $this->db->order_by($orderBy);
		$data = $this->db->get($this->getTable());
		return $data->result_object();
	}
	
	function getDevice($id = 0){
		return $this->db->get_where($this->getTable(), array('device_id' => $id))->row();
	}	
}

?>